]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[placeDisplay] Show a message when unmount fails
authorFlorian Müllner <fmuellner@src.gnome.org>
Wed, 10 Mar 2010 14:25:08 +0000 (15:25 +0100)
committerFlorian Müllner <fmuellner@src.gnome.org>
Thu, 18 Mar 2010 00:43:18 +0000 (01:43 +0100)
When an unmount operation fails, the only feedback given currently
is an exception on stderr. Use the infoBar to display an error
message and allow the user to retry the operation.

https://bugzilla.gnome.org/show_bug.cgi?id=612200

js/ui/placeDisplay.js

index 9e3ed87b03e0ece242a9c14b81a890336cfd6459..67da06c650c22b12f505cc06ae773f6a0460312c 100644 (file)
@@ -97,7 +97,14 @@ PlaceDeviceInfo.prototype = {
     },
 
     _removeFinish: function(o, res, data) {
-        this._mount.unmount_finish(res);
+        try {
+            this._mount.unmount_finish(res);
+        } catch (e) {
+            let message = _("Failed to unmount '%s'").format(o.get_name());
+            Main.overview.infoBar.setMessage(message,
+                                             Lang.bind(this, this.remove),
+                                             _("Retry"));
+        }
     }
 };